#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
const int mod=998244353,inf=0x3f3f3f3f3f3f3f3f;
const int N=2e6+10,M=2e5+10;
mt19937 rnd(time(0));
int x,y;
int f[N];
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	freopen("op.in","r",stdin);
	freopen("op.out","w",stdout);
	cin >> x >> y;
//	x=1,y=1ll<<20;
	f[x]=1;
	for ( int i = x+1 ; i <= y ; i++ )
	{
		f[i]=f[i-1];
		if(i%2==0)f[i]+=f[i/2];
		f[i]%=mod;
//		cout << f[i] << " ";
//		if(__builtin_popcount(i)==1)cerr << f[i] << " ";
//		cerr << f[i] << " ";
	}
	cout <<  f[y];
	return 0;
}


